<%--
  Created by IntelliJ IDEA.
  User: ChadZhao
  Date: 12-2-12
  Time: 下午7:36
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <title>音视频审核</title>

    <style type="text/css">
        <!--
        .tr0 { }

        .tr1 { background-color: #f4f4f4; }

        body,td,th {
            font-size: 14px;
            color: #666666;
        }
        .form { width:99%; padding:5px;}
        .form th { text-align:right; font-weight:bold; padding:5px;}
        .form td { text-align:left; padding:5px;}
        .listinput { border:1px solid #ccc; padding:3px; background-image:url(<c:url value='/images/listinputbg.gif'/>); width:200px;height:24px;}
        .select1  { border:1px solid #ccc; padding:3px;}
        .button { background-image:url(<c:url value='/images/butbg.gif'/>); height:30px; line-height:30px; color:#FFFFFF; font-weight:bold; border:0px; cursor:hand;}
        a:link { font-size: 12px; color: #333333; text-decoration: none; font-family: "微软雅黑";}
        a:visited{ font-size: 12px; color: #333333; text-decoration: none; font-family: "微软雅黑";}
        a:hover {color:#666666; font-family: "微软雅黑";}
        -->
    </style>
</head>
<body onload="parent._setHeight()">
<form method="post">
    <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><div style='float:left'> <img height="14" src="<c:url value='/frame/book1.gif'/>" width="20" />&nbsp;音视频审核 </div>
      <div style='float:right;padding-right:8px;'>
        <!--  //保留接口  -->
      </div></td>
  </tr>
  <tr>
    <td height="1" background="<c:url value='/frame/sp_bg.gif'/>" style='padding:0px'></td>
  </tr>
</table>
    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="form">
        <tr style="height:20px;">
            <th style="width:150px;" align="right">
                所属版块：
            </th>
            <td style="width:160px;"><s:select name="partType" id="partType" theme="simple" cssClass="select1"
                list="#{'34':'工作视频','35':'教育讲座','36':'税官风采','37':'反腐警示','31':'动漫集锦','32':'经典红歌','33':'红色电影'}"/></td>
            <th nowrap>标题：</th>
            <td><s:textfield name="articleTitle" id="articleTitle" theme="simple" cssClass="listinput" cssStyle="width:180px;"/></td>
            <%--<th nowrap>录入时间：</th>--%>
            <%--<td nowrap>--%>
                <%--<s:textfield name="startDate" id="startDate" cssClass="listinput" cssStyle="width:80px;" theme="simple" readonly="true" onclick="new Calendar(null, null, 0).show(this);"/> &nbsp;-&nbsp;--%>
               <%--<s:textfield name="endDate" id="endDate" cssClass="listinput" cssStyle="width:80px;" theme="simple" readonly="true" onclick="new Calendar(null, null, 0).show(this);"/>--%>
            <%--</td>--%>
            <th nowrap>
                状态：
            </th>
            <td><s:select name="status" id="status" theme="simple" cssClass="select1" list="#{'A':'全部','0':'未审核','1':'审核通过','2':'审核未通过'}"/></td>
            <td>
                <button type="button" id="queryBt" style="width:50px;" class="button" onclick="doQuery()">查询</button>&nbsp;
            </td>
        </tr>
    </table>
    <s:if test="pageVO != null">
    <table width="98%" align="center" border="0" cellpadding="5" cellspacing="1" style="margin-bottom:8px;margin-top:8px;">
  <%--<tr>--%>
    <%--<td background="<c:url value='/frame/wbg.gif'/>" bgcolor="#EEF4EA" class='title'><span><img align="absmiddle" src="<c:url value='/frame/ico.jpg'/>" width="13" height="15">文章列表</span></td>--%>
  <%--</tr>--%>
  <tr bgcolor="#FFFFFF">
    <td align="center"><table width="100%"  border="0" cellpadding="0" cellspacing="0">
        <tr align="center" style="background-image:url(<c:url value='/frame/lititbg_06.jpg'/>) ">
            <th height="29" nowrap>标题</th>
            <th width="100" nowrap>发布时间</th>
            <th width="100" nowrap>类型</th>
            <th width="140" style="text-align: center;" nowrap>状态</th>
            <th width="100" nowrap>操作</th>
        </tr>
       <s:iterator value="%{pageVO.dataList}" id="dl" status="num">
      <tr class='tr<s:property value="#num.index%2"/>' onMouseMove="javascript:this.bgColor='#ddf5d4';" onMouseOut="javascript:this.bgColor='#FFFFFF';">
        <td align="left" height="29">
            <s:if test="#dl.COLLECTFLAG==\"1\"">
                <a href="<c:url value='/system/toCheckVideoDetailList.do?articleId='/><s:property value="#dl.ID"/>&partType=<s:property value="partType"/>" style="color:#0000FF;"><s:property value="#dl.TITLE"/></a>
            </s:if><s:else>
                <a href="<c:url value='/viewMainVideoInfo.do?articleId='/><s:property value="#dl.ID"/>&partType=<s:property value="partType"/>" style="color:#0000FF;"><s:property value="#dl.TITLE"/></a></td>
            </s:else>
          </td>
        <td align="center"><s:property value="#dl.INSERTDATE"/></td>
        <td align="center"><s:if test="#dl.VIDEOAUDIOFLAG==\"1\"">视频</s:if><s:elseif test="#dl.VIDEOAUDIOFLAG==\"2\"">音频</s:elseif></td>
        <td align="center">
            <s:if test="#dl.COLLECTFLAG==\"0\"">
            <s:if test="#dl.STATUS==\"0\"">待审核</s:if>
            <s:elseif test="#dl.STATUS==\"1\"">审核通过</s:elseif>
            <s:elseif test="#dl.STATUS==\"2\"">审核未通过</s:elseif>
            </s:if><s:else>
            <s:if test="status==\"0\"">待审核</s:if><s:elseif test="status==\"1\"">审核通过</s:elseif><s:elseif test="status==\"2\"">审核未通过</s:elseif>分集数：<s:property value="#dl.PARTNUM"/></s:else>
            </td>
        <td align="center">
            <s:if test="#dl.COLLECTFLAG==\"0\" && #dl.STATUS==\"0\"">
                <a href="<c:url value='/system/editVideoInfo.do?dataType=2&articleId='/><s:property value="#dl.ID"/>&partType=<s:property value="partType"/>">审核</a>
            </s:if>
                <a href="#" onclick="doDelVideo('<s:property value="#dl.ID"/>','<s:property value="#dl.VIDEOAUDIOFLAG"/>')">删除</a>
          </td>
      </tr>
    </s:iterator>
        <tr style="height:26px;font-size: 12px;">
            <td colspan="5" style="padding-right:6px;text-align: right;">
                共<s:property value="%{pageVO.totalCount}"/>条
                共<s:property value="%{pageVO.totalPage}"/>页
                第<s:property value="%{pageVO.currentPage}"/>页
                <s:if test="%{pageVO.currentPage > 1}">
                    <a href="#" onclick='toPage(1);return false;'>[首页]</a>
                    <a href="#"
                       onclick='toPage(<s:property value="pageVO.priviousPage"/>);return false'>[上一页]</a>
                </s:if>
                <s:if test="%{pageVO.totalPage > pageVO.currentPage}">
                    <a href="#" onclick='toPage(<s:property value="pageVO.nextPage"/>);return false;'>[下一页]</a>
                    <a href="#" onclick='toPage(<s:property value="pageVO.totalPage"/>);return false;'>[尾页]</a>
                </s:if>
                <input name="goPage" type="text" class="listinput" style="width:28px;" size="1"/>&nbsp;
                <button type="button" class="button" style="width:32px;" onClick="jumpToPage()">GO</button>
                &nbsp;
            </td>
        </tr>
    </table>
        </s:if>
    </form>
</body>
<script language="javascript" src="<c:url value='/script/Calendar.js'/>"></script>
<script>
    parent._setHeight();

    function doQuery(){
        document.forms[0].action="<c:url value='/system/checkQueryVideos.do?targerPageNum=1'/>";
        document.forms[0].submit();
    }

    function doDelVideo(theid,thevflag){
        var mess = "您确定删除这部视频合集及其下的分集吗？";
        if(thevflag=="2") mess = "您确定删除这部音频合集及其下的分集吗？";
        if(!confirm(mess)){
            return;
        }
        document.forms[0].action="<c:url value='/system/delVideoInfo.do?targerPageNum=1&dataType=2&articleId='/>"+theid;
        document.forms[0].submit();
    }

    function toPage(pageNum) {
        document.forms[0].action = "<c:url value='/system/checkQueryVideos.do?targerPageNum='/>"+ pageNum;
        document.forms[0].submit();
    }

    function jumpToPage() {
        var iForm = document.forms[0];
        if (iForm.goPage.value == "") {
            alert("请输入要跳转到的页数！");
            return;
        }
        if (isNaN(iForm.goPage.value)) {
            alert("页数只能为整数！");
            return;
        }
        var toPageNum = parseInt(iForm.goPage.value);
        if (toPageNum < 1 || toPageNum > <s:if test="%{pageVO.totalPage != null}"><s:property value="%{pageVO.totalPage}"/></s:if><s:else>1</s:else>) {
            alert("页数输入有误！");
            return;
        }
        toPage(toPageNum);
    }
</script>
</html>